/**
 * AlertQueryServiceImpl.java
 * Created at 2017-11-2
 * Created by zhanghailin
 * Copyright (C) 2017 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.rms.system.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.broadtext.common.exp.DaoException;
import com.broadtext.common.exp.ServiceException;
import com.broadtext.common.repository.EntityDao;
import com.broadtext.common.service.impl.EntityServiceImpl;
import com.broadtext.rms.system.model.TtPackCustomAlert;
import com.broadtext.rms.system.service.IAlertQueryService;

/**
 * <p>ClassName: AlertQueryServiceImpl</p>
 * <p>Description: TODO</p>
 * <p>Author: zhanghailin</p>
 * <p>Date: 2017-11-2</p>
 */
@Service("alertQueryService")
public class AlertQueryServiceImpl extends EntityServiceImpl<TtPackCustomAlert> implements IAlertQueryService{
    
    @Autowired
    @Qualifier("alertQueryDao")
    public void setEntityDao(EntityDao<TtPackCustomAlert> entityDao) {
        super.entityDao = entityDao;
    }

    /** (non-Javadoc)
     * <p>Title: findPackModelOpt</p>
     * <p>Description: </p>
     * @return
     * @throws ServiceException
     * @see com.broadtext.rms.system.service.IAlertQueryService#findPackModelOpt()
     */
    @SuppressWarnings("unchecked")
    @Override
    public List<Object> findPackModelOpt() throws ServiceException {
        List<Object> list = new ArrayList<Object>();
        try {
            list = this.entityDao.findByProperty("com.broadtext.rms.system.model.TtPackCustomAlert.findPackModelOpt", null);
        } catch (DaoException e) {
            e.printStackTrace();
            throw new ServiceException(e);
        }
        return list;
    }

    /** (non-Javadoc)
     * <p>Title: findExportDataList</p>
     * <p>Description: </p>
     * @param map
     * @return
     * @throws ServiceException
     * @see com.broadtext.rms.system.service.IAlertQueryService#findExportDataList(java.util.Map)
     */
    @SuppressWarnings("unchecked")
    @Override
    public List<Map<String, String>> findExportDataList(Map<String, Object> map) throws ServiceException {
        List<Map<String, String>> list;
        try {
            list = this.entityDao.findByProperty("com.broadtext.rms.system.model.TtPackCustomAlert.findExportDataList", map);
        } catch (DaoException e) {
            e.printStackTrace();
            throw new ServiceException(e);
        }
        return list;
    }

    /** (non-Javadoc)
     * <p>Title: getPackCodeList</p>
     * <p>Description: </p>
     * @param key
     * @return
     * @throws ServiceException
     * @see com.broadtext.rms.system.service.IAlertQueryService#getPackCodeList(java.lang.String)
     */
    @SuppressWarnings("unchecked")
    @Override
    public List<String> getPackCodeList(String key) throws ServiceException {
        List<String> list;
        try {
            list = this.entityDao.findByProperty("com.broadtext.rms.system.model.TtPackCustomAlert.getPackCodeList", key);
        } catch (DaoException e) {
            e.printStackTrace();
            throw new ServiceException(e);
        }
        return list;
    }
    
    
    
}
